const Router = require('koa-router')
const sportsRouter = new Router({ prefix: '/sports' })

const { verifyAuth } = require('../middleware/authMiddleware')
const {
  createSports,
  getAllSports,
  removeSportsById,
  updateSportsById,
} = require('../controller/sportsController')
//创建运动项目
sportsRouter.post('/',verifyAuth,createSports)
//获取所有项目
sportsRouter.post('/list', verifyAuth, getAllSports)

//删除项目
sportsRouter.delete('/:id', verifyAuth, removeSportsById)
//编辑项目
sportsRouter.patch('/:id', verifyAuth, updateSportsById)



module.exports = sportsRouter